﻿// Copyright (c) KriaSoft, LLC.  All rights reserved.  See LICENSE.txt in the project root for license information.

namespace FI.AspNet.Identity.EntityFramework
{
    using Microsoft.AspNet.Identity;
    using System;
    using System.Security.Claims;
    using System.Threading;
    using System.Threading.Tasks;

    public partial class User : IUser<string>
    {
       

        public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<User, string> manager)
        {

            // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
            try
            {
                Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
                var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);

                // Add custom user claims here
                return userIdentity;
            }
            catch  
            {
                throw;

            }


        }
    }
}
